package com.woniuxy02;

/**
 * @author 作者
 * @create 2025-07-24 10:54
 */
public class CarFactory {

//    public Benz createBenz() {
//        return new Benz();
//    }
//
//    public Bmw createBmw() {
//        return new Bmw();
//    }

    public static Car createCar(String type) {
        Car car = null;
        switch (type) {
            case "bmw":
                car = new Bmw();
                break;
            case "benz":
                car = new Benz();
                break;
        }
        return car;
    }
}
